package com.example.demo.java8.stream.stream_20200328;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 13:44 2020/3/28
 * @Modified By:
 */
public class StreamApiTest2 {

    public static Stream<String> apply(List t) {
        return t.stream();
    }

    /**
     * 映射map
     */
    @Test
    public void test1() {
        ArrayList stringList = new ArrayList();

        ArrayList stringList2 = new ArrayList();
        stringList.add("ddd2");
        stringList.add("aaa2");
        //        stringList2.add("aaa");
        stringList2.add(stringList);
        stringList2.stream().flatMap(t -> apply((List) t)).forEach(System.out::println);
    }

}
